const symbolSalary = Symbol.for("ins_symbol_attr_salary");

function Person(age, name) {
  this.ins_in_attr_age = age;
  this.ins_in_attr_name = name;
}

const person = new Person(100, "程序员");

//Symbol 属性
person[symbolSalary] = 6000;
person["ins_no_enumerable_attr_sex"] = "男";

// sex 不可枚举
Object.defineProperty(person, "ins_no_enumerable_attr_sex", {
  enumerable: false,
});

Object.defineProperty(person, symbolSalary, {
  enumerable: false,
  value: 999,
});

//
function getNoEnumerable(_obj) {
  //获取原型对象
  const keys = Reflect.ownKeys(_obj);
  // const result = keys.filter(key=> {
  //     return !Object.getOwnPropertyDescriptor(_obj, key).enumerable
  // })
  // return result;
  const result = keys.filter((key) => {
    return !Object.prototype.propertyIsEnumerable.call(_obj, key);
  });
  return result;
}

console.log(getNoEnumerable(person));
